<%@ page import="java.util.List" %>
<%@ page import="com.education.service.bean.ActivityBean" %><%--
  Created by IntelliJ IDEA.
  User: Fan
  Date: 2016/9/26
  Time: 20:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport"
          content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>Welcome</title>
    <style type="text/css">
        body {
            background-image: url(/images/background.jpg);
            /*background-repeat: repeat-x;*/
            background-size: 100%;
        }

        select {
            margin: 2px;
        }

        select:hover {
            border: 2px solid #666666;
        / / 鼠标移上的效果
        }

        div input {
            margin: 3px;
        }

        select {
            background: transparent;
        }

        #index {
            border-radius: 10px;
        }

        #check {
            margin-top: 7px;
            /*margin-left: 30px;*/
            /*background: url(/images/check_24x20.png) no-repeat;*/
            /*width:8%;*/
            /*height:100%;*/
        }

        #check:hover {
            border: 3px solid #666666;
        / / 鼠标移上的效果
        }

        #back {

            float: left;
            margin-left: 70px;
        }

        #forward {
            float: right;
            margin-right: 70px;
        }

        .bottom {
            position: absolute;
            bottom: 50px;
            left: 0;
            height: 20px;
            width: 100%;
        }
    </style>
</head>
<body>
<script language="JavaScript">
    function getSelectedValue() {
        var catagory = document.getElementById("catagorySelect").value;
        var school = document.getElementById("schoolSelect").value;
        var major = document.getElementById("majorSelect").value;
        var course = document.getElementById("courseSelect").value;
        var path = 'res' + "\\" + catagory + "\\" + school + "\\" + major + "\\" + course;
//          return path;
//          window.location.href="getPathServlet?path="+path;
        window.location.href = "/Pages/listFiles.jsp?path=" + path;
    }
    function findKeyWord() {
        var keyword = document.getElementById("keyword").value;
        window.location.href = "${pageContext.request.contextPath}/FindKeyWordServlet?keyword=" + keyword;

    }
</script>
<h4></h4>
<div align="center"><h3></h3>
    <%--<video id="paly1" style="margin:7px" controls="controls"  autoplay="autoplay" width="600" height="500" src="..\res\computer\CDUT\program\Cplusplus\movie.mp4" >--%>
    <%--Your browser does not support HTML5 video--%>
    <%--</video>--%>
    <img id="index" src="images/index4.png" width="100%" height="80%">
</div>
<div>请选择分类：</div>

<%--<form action="getPathServlet" method="post" name="getPath">--%>
<div>
    学科分类<select id="catagorySelect" name="catagoryName">
        <%
            List<ActivityBean> infoCatagortyBean = (List) request.getAttribute("infocatagorybean");
            if (infoCatagortyBean.size() == 0) {
                out.println("当前选项为空");
            } else {
                for (int i = 0; i < infoCatagortyBean.size(); i++) {
                    String catagoryValue = infoCatagortyBean.get(i).getValue();
                    String catagoryName = infoCatagortyBean.get(i).getName();
        %>
        <option value="<%=catagoryValue%>"><%=catagoryName%>
        </option>
        <%
                }
            }
        %>
    </select><br>

    学校分类<select id="schoolSelect" name="schoolName">
        <%
            List<ActivityBean> infoSchoolBean = (List) request.getAttribute("infoschoolbean");
            if (infoSchoolBean.size() == 0) {
                out.println("当前选项为空");
            } else {
                for (int i = 0; i < infoSchoolBean.size(); i++) {
                    String schoolValue = infoSchoolBean.get(i).getValue();
                    String schoolName = infoSchoolBean.get(i).getName();
        %>
        <option value="<%=schoolValue%>"><%=schoolName%>
        </option>
        <%
                }
            }
        %>
    </select><br>

    专业分类<select id="majorSelect" name="majorName">
        <%
            List<ActivityBean> infoMajorBean = (List) request.getAttribute("infomajorbean");
            if (infoMajorBean.size() == 0) {
                out.println("当前选项为空");
            } else {
                for (int i = 0; i < infoMajorBean.size(); i++) {
                    String majorValue = infoMajorBean.get(i).getValue();
                    String majorName = infoMajorBean.get(i).getName();
        %>
        <option value="<%=majorValue%>"><%=majorName%>
        </option>
        <%
                }
            }
        %>
    </select><br>

    课程分类<select id="courseSelect" name="courseName">
        <%
            List<ActivityBean> infoCourseBean = (List) request.getAttribute("infocoursebean");
            if (infoCourseBean.size() == 0) {
                out.println("当前选项为空");
            } else {
                for (int i = 0; i < infoCourseBean.size(); i++) {
                    String courseValue = infoCourseBean.get(i).getValue();
                    String courseName = infoCourseBean.get(i).getName();
        %>
        <option value="<%=courseValue%>"><%=courseName%>
        </option>
        <%
                }
            }
        %>
    </select><br>

    <a style="visibility: hidden">点击确定</a><input id="check" type="button" value="确定" onclick="getSelectedValue()"/>
</div>
<br>
<%--<input type="submit" value="确定" onclick="getPath();">--%>
<%--</form>--%>

<%--<input type="button" value="所选值"--%>
<%--onclick="alert(getSelectedValue())"; />--%>
<%--<form action="/FindKeyWordServlet?keyword=" + <%=%></form>--%>
<div style="margin: 0 auto;text-align:center; "><input id="keyword" type="text" VALUE="请输入关键字"
                                                       onfocus="javascript:if(this.value=='请输入关键字')this.value='';">
    <button type="submit" onclick="findKeyWord()">查询</button>
</div>
<a href="user/UserLogin.jsp" style="float: right;"><img src="images/user_18x24.png"></a><br>

<%--<button onclick="window.location.href='./admin/AdminLogin.jsp'" style="float:right">管理员登录</button>--%>
<%--<button onclick="window.location.href='./user/UserLogin.jsp'" style="float:right">用户登录</button></br></br>--%>
<div class="bottom"><img id="back" src="images/arrow_left_24x24.png" onclick="window.history.back()"><img id="forward"
                                                                                                           src="images/arrow_right_24x24.png"
                                                                                                           onclick="window.history.forward()">
</div>

</body>
</html>
